<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    #myCanvas {
      background: skyblue;
    }
  </style>
</head>

<body>
  <img src="./33.png" id="scream">
  <canvas id="myCanvas" width="400" height="400"></canvas>
  <!-- 矢量图 -->
  <svg xmlns="http://www.w3.org/2000/svg" version="1.1">
    <circle cx="100" cy="50" r="40" stroke="black" stroke-width="2" fill="red" />
  </svg>
  <script>
    window.onload = function () {
      var c = document.getElementById("myCanvas");
      var ctx = c.getContext("2d");
      var img = document.getElementById("scream");
      console.log(img)
      ctx.beginPath();
      //   x轴  y轴
      ctx.drawImage(img, 10, 10);
      ctx.stroke();
      ctx.moveTo(50, 50)
      ctx.lineTo(100, 100)
      ctx.stroke();
    }
  </script>
</body>

</html>